/*
 * myqueue.h -- interface for queue ops
 */

#ifndef MYQUEUE_H
#define MYQUEUE_H

#include <malloc.h>
#include <stdio.h>

typedef struct mythread_queue {
  void *item;
  struct mythread_queue *prev, *next;
  int prio;
} *mythread_queue_t;

/* Initialize the queue*/
void mythread_q_init(mythread_queue_t *headp, void *item, int prio);

/* Enqueue the new item at the tail of any items at the same priority level*/
void mythread_enq(mythread_queue_t *headp, void *item, int prio);

/* Remove elements from the queue*/
void mythread_deq(mythread_queue_t *headp, void *item);

#endif MYQUEUE_H
